// Copyright (c) 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "EventTypeNames.h"

#include "wtf/StdLibExtras.h"

// Generated from:
// - blink\in\crawler\EventTypeNames.in

namespace blink {
namespace EventTypeNames {

using namespace WTF;

void* NamesStorage[EventTypeNamesCount * ((sizeof(AtomicString) + sizeof(void *) - 1) / sizeof(void *))];

const AtomicString& DOMCharacterDataModified = reinterpret_cast<AtomicString*>(&NamesStorage)[0];
const AtomicString& DOMContentLoaded = reinterpret_cast<AtomicString*>(&NamesStorage)[1];
const AtomicString& DOMNodeInserted = reinterpret_cast<AtomicString*>(&NamesStorage)[2];
const AtomicString& DOMNodeInsertedIntoDocument = reinterpret_cast<AtomicString*>(&NamesStorage)[3];
const AtomicString& DOMNodeRemoved = reinterpret_cast<AtomicString*>(&NamesStorage)[4];
const AtomicString& DOMNodeRemovedFromDocument = reinterpret_cast<AtomicString*>(&NamesStorage)[5];
const AtomicString& DOMSubtreeModified = reinterpret_cast<AtomicString*>(&NamesStorage)[6];
const AtomicString& animationend = reinterpret_cast<AtomicString*>(&NamesStorage)[7];
const AtomicString& animationiteration = reinterpret_cast<AtomicString*>(&NamesStorage)[8];
const AtomicString& animationstart = reinterpret_cast<AtomicString*>(&NamesStorage)[9];
const AtomicString& beforeunload = reinterpret_cast<AtomicString*>(&NamesStorage)[10];
const AtomicString& error = reinterpret_cast<AtomicString*>(&NamesStorage)[11];
const AtomicString& load = reinterpret_cast<AtomicString*>(&NamesStorage)[12];
const AtomicString& mousewheel = reinterpret_cast<AtomicString*>(&NamesStorage)[13];
const AtomicString& pagehide = reinterpret_cast<AtomicString*>(&NamesStorage)[14];
const AtomicString& pageshow = reinterpret_cast<AtomicString*>(&NamesStorage)[15];
const AtomicString& readystatechange = reinterpret_cast<AtomicString*>(&NamesStorage)[16];
const AtomicString& scroll = reinterpret_cast<AtomicString*>(&NamesStorage)[17];
const AtomicString& transitionend = reinterpret_cast<AtomicString*>(&NamesStorage)[18];
const AtomicString& unload = reinterpret_cast<AtomicString*>(&NamesStorage)[19];
const AtomicString& webkitAnimationEnd = reinterpret_cast<AtomicString*>(&NamesStorage)[20];
const AtomicString& webkitAnimationIteration = reinterpret_cast<AtomicString*>(&NamesStorage)[21];
const AtomicString& webkitAnimationStart = reinterpret_cast<AtomicString*>(&NamesStorage)[22];
const AtomicString& webkitTransitionEnd = reinterpret_cast<AtomicString*>(&NamesStorage)[23];
const AtomicString& wheel = reinterpret_cast<AtomicString*>(&NamesStorage)[24];

void init()
{
    struct NameEntry {
        const char* name;
        unsigned hash;
        unsigned char length;
    };

    static const NameEntry kNames[] = {
        { "DOMCharacterDataModified", 1747391, 24 },
        { "DOMContentLoaded", 10217403, 16 },
        { "DOMNodeInserted", 3305523, 15 },
        { "DOMNodeInsertedIntoDocument", 9765719, 27 },
        { "DOMNodeRemoved", 15338285, 14 },
        { "DOMNodeRemovedFromDocument", 16284219, 26 },
        { "DOMSubtreeModified", 6084203, 18 },
        { "animationend", 2356336, 12 },
        { "animationiteration", 4399371, 18 },
        { "animationstart", 1171773, 14 },
        { "beforeunload", 16009443, 12 },
        { "error", 6654137, 5 },
        { "load", 8207817, 4 },
        { "mousewheel", 15891108, 10 },
        { "pagehide", 16640617, 8 },
        { "pageshow", 12320166, 8 },
        { "readystatechange", 11011948, 16 },
        { "scroll", 7626286, 6 },
        { "transitionend", 9031405, 13 },
        { "unload", 4411490, 6 },
        { "webkitAnimationEnd", 11845628, 18 },
        { "webkitAnimationIteration", 9040977, 24 },
        { "webkitAnimationStart", 4844440, 20 },
        { "webkitTransitionEnd", 16021356, 19 },
        { "wheel", 5389519, 5 },
    };

    for (size_t i = 0; i < WTF_ARRAY_LENGTH(kNames); i++) {
        StringImpl* stringImpl = StringImpl::createStatic(kNames[i].name, kNames[i].length, kNames[i].hash);
        void* address = reinterpret_cast<AtomicString*>(&NamesStorage) + i;
        new (address) AtomicString(stringImpl);
    }
}

} // EventTypeNames
} // namespace blink
